/*
 * @Author: wangshuixin 2412658453@qq.com
 * @Date: 2024-11-26 17:04:33
 * @LastEditors: wangshuixin 2412658453@qq.com
 * @LastEditTime: 2024-12-10 09:04:28
 * @FilePath: \sr_system_manager_ui\src\api\resultsManagement\otherApi.ts
 * @Description: 其他成果模块Api
 */
import request from '@/utils/request'
import { OtherPageReqDTO } from './types'
import type { OtherListResp } from '@/types/resultsManagement'
import type { PaginationQueryUniteRespDTO, AppStateChangeRespDTO } from '@/types/index'

// 其他成果 分页查询
export function getOtherListApi(params: OtherPageReqDTO) { 
  return request<PaginationQueryUniteRespDTO<OtherListResp>>({
    url: `/achv/other/page`,
    method: 'post',
    data: params
  })
}

// 获取 其他成果 详情
export function getOtherDetailApi(params) { 
  return request<OtherListResp>({
    url: `/achv/other/detail`,
    method: 'post',
    data: params
  })
}

// 创建 其他成果 详情
export function createOtherDetailApi(params) {
  return request<AppStateChangeRespDTO>({
    url: `/achv/other/create`,
    method: 'post',
    data: params
  })
}

// 更新 其他成果 详情
export function updateOtherDetailApi(params) {
  return request<AppStateChangeRespDTO>({
    url: `/achv/other/update`,
    method: 'post',
    data: params
  })
}

/**
 * 导出 其他成果
 * @param {number} unStatus 不包含状态
 * @param {string} createdBy 创建人id
 * @param {string} departmentId 部门id
 * @param {string} idList 导出id
*/
export function exportOtherApi(params: { unStatus?: number, createdBy?: string, departmentId?: string, idList?: string[] }) {
  return request({
    url: `/achv/other/export`,
    method: 'post',
    responseType: 'blob',
    data: params
  })
}